<template>
<!-- 写页面用的-->
     <!-- vue2 只能有一个外层div-->
    <div class="order">

222222222222222222222222222222222222222222222226666666666666666666666666
        
    </div>
 
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return {
             pageNo: 1, //默认值为1
             tableData1:[]
        }
    },
    created(){

    },
    mounted(){
        this.getList()
    },
    methods:{
        getList(){
            let _this = this
            axios.get('https://ys.lumingx.com/api/manage/GoodsList', {
                params: {
                    pageNo: _this.pageNo,
                    pageSize:10
                }
            })
            .then(function (res) {
                console.log(res.data);
                _this.tableData1 = res.data.data
                _this.handleData(_this.tableData1)
            })
        },
        handleData(data){
            for(var i=0;i<data.length;i++){
                data[i].CreateDate = data[i].CreateDate.split("T")[0]
            }
        },
         handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.pageNo = val   //将点击获取的值赋值给pageNo
            this.getList()     //查询的时候，使用的pageNo就是刚才赋值的那个最新的值，比如刚才点击的是3，现在pageNo=3
        }
    }
}
</script>
<style lang="less" scoped>
.goods{
    .goods-list{
      .goods-img{
          width: 50px;
          height: 50px;
          display: block;
      }
    }
    .page-pagination{
        text-align: right;
    }
}

</style>